﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ResetPassword.aspx.cs" Inherits="ResetPassword" MasterPageFile="~/Mobile.master" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<form id="Form1" runat="server">
<section>
<header id="header">
<nav id="nav">
<a href="default.aspx"><div class="branding"></div></a>
<div class="nav">
<%--<uc1:usrLanguage runat="server" ID="hplLanguage" />--%>
<a href="default.aspx"><asp:Image ID="imgTop" runat="server" ImageUrl="<%$Resources:CarInsurance,TopNavBack%>" Width="49" Height="29" AlternateText="Start" BorderWidth="0" /></a></div>
</nav>
</header>
</section>
    <section id="body">
<div class="body">
<div class="padding_lr30px">
                                <h3>
                                    <%= GetGlobalResourceObject("Menu","ResetPassword") %>
                                </h3>
                                <div class="seperator_15px">
                                </div>
                                <div id="CarForm">
                                    <asp:Label ID="lblAutoKey" Visible="false" runat="server"></asp:Label>
                                    <asp:Label ID="lblGUID" Visible="false" runat="server"></asp:Label>
                                    <asp:ValidationSummary ID="vsResetPassword" CssClass="errorSummary" HeaderText="Oops... Please complete the form"
                                        runat="server" ValidationGroup="resetpassword" />
                                    <%--<div>
                                            <div class="form_col_1 comp left">
                                                Garage Type</div>
                                            <div class="form_col_2 left">
                                                <select name="select">
                                                    <option>Select ...</option>
                                                </select>
                                            </div>
                                            <div class="left">
                                                <img src="/images/icon/help.png" width="20" height="20" alt="Help" /></div>
                                        </div>
                                        <div class="seperator_form">
                                        </div>--%>
                                    <div>
                                        <div>
                                            <%= GetGlobalResourceObject("Menu","EnterNewPassword") %></div>
                                        <div>
                                            <asp:TextBox ID="txtNewPassword" runat="server" MaxLength="20" Width="200px" TextMode="Password"></asp:TextBox>
                                            <asp:RequiredFieldValidator ID="rfvNewPassword" CssClass="validationErrorControl"
                                                runat="server" ControlToValidate="txtNewPassword" Display="Dynamic" ErrorMessage=""
                                                Text="" ValidationGroup="resetpassword">
                                            </asp:RequiredFieldValidator>
                                        </div>
                                    </div>
                                    <div class="seperator_form">
                                    </div>
                                    <div>
                                        <div>
                                            <%= GetGlobalResourceObject("Menu","RetypeNewPassword") %></div>
                                        <div>
                                            <asp:TextBox ID="txtRetypeNewPassword" runat="server" MaxLength="20" Width="200px"
                                                TextMode="Password"></asp:TextBox>
                                            <asp:RequiredFieldValidator ID="rfvRetypePassword" CssClass="validationErrorControl"
                                                runat="server" ValidationGroup="resetpassword" ErrorMessage="" Text="" Display="Dynamic"
                                                ControlToValidate="txtRetypeNewPassword"></asp:RequiredFieldValidator>
                                            <asp:CompareValidator ID="csvRetypePassword" runat="server" CssClass="validationErrorControl"
                                                Display="Dynamic" ValidationGroup="resetpassword" ErrorMessage="" Text="Both password should be same."
                                                ControlToValidate="txtRetypeNewPassword" ControlToCompare="txtNewPassword"></asp:CompareValidator>
                                        </div>
                                    </div>
                                    <div class="seperator_form">
                                    </div>
                                    <div class="seperator_15px">
                                    </div>
                                    <div>
                                        <div >
                                            &nbsp;
                                        </div>
                                        <div >
                                            <asp:Button ID="btnSubmit" CssClass="button_resetpassword" OnClientClick="LoadValidationErrorCss();if (Page_ClientValidate('resetpassword')){this.className = 'button_processing';}"
                                                runat="server" OnClick="btnSubmit_Click" ValidationGroup="resetpassword" />
                                        </div>
                                    </div>
                                    <div>
                                        <div>
                                            &nbsp;
                                        </div>
                                        <div>
                                            <asp:Label ID="lblMessage" ForeColor="Red" runat="server"></asp:Label>
                                        </div>
                                    </div>
                                </div>
                            </div>
</div> 
</section>
</form>
<script type="text/javascript">
      function CheckPasswordLength(source, arguments) {
          //var corglen = arguments.Value;
          var cval = arguments.Value;
          var bValid = true;
          var chList = new Array(20);
          var ctrlsource = document.getElementById(source.id);

          //alert("ORG LEN : " + corglen.length + " AFTER : " + cval.length);
          if (cval.indexOf(' ') != -1 || cval.indexOf('\'') != -1
                        || cval.indexOf('\"') != -1 || cval.indexOf('~') != -1) {
              if (ctrlsource.textContent) {
                  ctrlsource.textContent = "Password include invalid character or space!";
              }
              else {
                  ctrlsource.innerText = "Password include invalid character or space!";
              }

              ctrlsource.errormessage = "Password include invalid character or space!";
              bValid = false;
          }
          else if (cval.length < 6) {
              //ctrlsource.innerText = "Password length should be at least 6";
              if (ctrlsource.textContent) {
                  ctrlsource.textContent = "Password length should be at least 6";
              }
              else {
                  ctrlsource.innerText = "Password length should be at least 6";
              }

              ctrlsource.errormessage = "Password length should be at least 6";
              bValid = false;
          }
          else if (cval.length > 20) {
              bValid = false;
              //ctrlsource.innerText = "Password length should not be over 20!";
              if (ctrlsource.textContent) {
                  ctrlsource.textContent = "Password length should not be over 20!";
              }
              else {
                  ctrlsource.innerText = "Password length should not be over 20!";
              }
              ctrlsource.errormessage = "Password length should not be over 20!";
          }
          else {
              bValid = true;
          }
          //alert(cval);
          //if (isNaN(cval)){
          //    bValid = false;
          //} 


          //alert(bValid);
          arguments.IsValid = bValid;
          return;
      }
    </script>
</asp:Content>
